<?php
/**
 *	Responsible for connect in the database server
 *	@author Renan Henrique Abreu <renanhabreu@gmail.com>
 *	@version 1.0
 *	@package Nucleo
 *	@subpackage Nucleo.Model
 *      @copyright 2009-2010 Renan Abreu
 */
class Nucleo_Model_Connection {
    static protected $db = null;


    public function __construct() {
        self::getConnection();
    }

    /**
     * Will build a connection with database
     * @return object PDO
     */
    static public function getConnection() {

        try {
            self::$db = new PDO(DNS,USER,PASS);

        }catch(PDOException $e) {
            echo Nucleo_Language_Translate::sifraMsg('010').'<br />'
		 .'<h3>'.$e->getMessage().'</h3>';
            
            exit();
        }

        return self::$db;
    }

    /**
     *Get a Connection
     *@access public
     *@return object PDO
     *@deprecated sice version 2.0.4
     */
    public function getConn() {
        return self;
    }


}


?>
